package javaday02;

import java.util.Random;

public class Homework2Copyarray {
	public static void main(String args[]){
		int[] arrA ={1,2,3,4,5};
		int[] arrB ={6,7,8,9,10};
		int[] arrcopy=new int[5];
		Random random = new Random();
		for(int i =0;i<arrA.length;i++){
			int x = random.nextInt(2);
			if(x==0){
				arrcopy[i]=arrA[i];
			}else{
				arrcopy[i]=arrB[i];
			}
		}
		int point=1;
		System.out.print("{");
		for(int i =0;i<arrcopy.length;i++){
			System.out.print(arrcopy[i]);
			int l = arrcopy.length;
			if(point !=l){
				System.out.print(",");
			}
			point++;
		}
		System.out.println("}");
	}
}
